<html>
    <head>
        <meta charset="UTF-8">
        <title>属性操作函数</title>
        <script type="text/javascript">
            function fun1(){
                var $option = $("#city>option:selected");
                alert("value="+$option.val());
                alert("title="+$option.attr('title'));
                alert("文字显示内容="+$option.text());
                alert("selected="+$option.prop("selected"));

            }
        
        
        </script>
        <script type="text/javascript" src="JQuery-js文件/jquery-3.3.1.js"> </script>
        <body>
            <center>
                <select id="city" onclick="fun1();">
                    <option value="bj" title="beijing" selected>北京</option>
                    <option value="sh" title="beijing">上海</option>
                    <option value="gz" title="beijing">广州</option>
                    <option value="hz" title="beijing">杭州</option>
                    <option value="sz" title="beijing" >深圳</option>
                </select>
            </center>

        </body>
    </head>
</html>